
	<div class="pop_form">
	<?php $form = $this->beginWidget('CActiveForm',array(
		'id'=>'news-form',
		'action'=>'/news/create',
		//'enableAjaxValidation'=>true,
		//'htmlOptions'=>array('onsubmit'=>'return false;'),
	));?>
		<!--
		<form id="" name="" action="/"  method="POST">
			<div class="pop_title">
				<p class="title">发布分享...</p>
				<a class="pop_del">删除</a>
			</div>
		-->
			<div class="pop_con">
				<div class="pop_left">
					<div class="web_p">
					<?php echo $form->labelEx($boxSeriaModel,'link_url'); ?>
					<p><?=$crawl['url']; ?></p>
					<?php echo $form->hiddenField($boxSeriaModel,'link_url',array('size'=>60,'maxlength'=>255,'style'=>'border:none;','value'=>$crawl['url'])); ?>
					<?php echo $form->error($boxSeriaModel,'link_url'); ?>
						
					</div>
					<div class="web_title_txt">
					<?php echo $form->labelEx($boxSeriaModel,'site_title'); ?>
					<?php echo $form->textField($boxSeriaModel,'site_title',array('size'=>60,'maxlength'=>255,'value'=>$crawl['title'])); ?>
					<?php echo $form->error($boxSeriaModel,'site_title'); ?>
					</div>
					<div class="web_con_txt">
						<?php echo $form->labelEx($boxSeriaModel,'news_desc'); ?>
						<textarea name="News[news_desc]" id="News_news_desc"><?=$crawl['description']?></textarea>
						<?php echo $form->error($boxSeriaModel,'news_desc'); ?>
					</div>
					<div class="web_lab_op clearfix">
						<?php echo $form->labelEx($boxSeriaModel,'news_tag');?>
						<div class="lab_op">
							<!-- 标签循环 start -->
							<?foreach($tag as $key=> $val):?>
							<div class="op">
								<span class="logo">标签</span>
								<a href="javascript:"class="name tagname" rel="<?=$val?>"><?=$val?></a>
							<!--	<a class="del" href="javascript:">删除</a>-->
							</div>
							<?endforeach?>
							<!-- 标签循环 end -->
						</div>
					</div>
					<div class="tip_con">
						<?php echo $form->textField($boxSeriaModel,'news_tag');?>
						<div class="jiantou"></div>
						<p class="tip_bor">
							<span class="con">
								请用
								<span class="tip">空格</span>
								分割多个标签
							</span>
						</p>
					</div>
					<?php echo $form->hiddenField($boxSeriaModel,'news_thumb',array('value'=>$crawl['img']['0'])); ?>
					<div class="pop_submit">
						<input type="submit" class="submit" value="发布" />
						<a class="cancel"href="javascript:;"/></a>
					</div>
				</div>
				<div class="pop_right" id="list_img">
					<div class="top_op">
						<span>缩略图</span>
						<a href="javascript:" onclick="next()" class="right_op" id="next">后一张</a>
						<a href="javascript:" onclick="prev();"class="left_op" id="prev" style="display:none;">前一张</a>						
					</div>
				

					<?
					$i = 0;
					foreach($crawl['img'] as $key => $img_url):
					?>
						<img src="<?=$img_url?>"id="list_<?=$i?>" <?if($key==0):?>style="display:block;"<?else:?>style="display:none;"<?endif?>alt="<?=$img_url?>"/>
					<?
					$i++;
					endforeach;?>
					<p class="page_tips">第<span id="page">1</span>/<?=count($crawl['img'])?>张</p>
				</div>
			</div>
	<?$this->endWidget();?>
	</div>
<script type="text/javascript">
	var list_img = $("#list_img").find("img");
	var length = list_img.length;
	list_img.each(function(){
		$(this).hide().LoadImage(true,138,140,"/images/loading.gif",'false');
	});
	var currentImg = $("#list_0");
	currentImg.show();
	var current = 0;
	function prev(){
		if(current<0 || current> length-1)return false;
		if(current==0)return false;
		if( current>0 && current<=length)show(--current);
		
	}
	function next(){
		if(current<0 || current>length)return false;
		if(current==length-1)return false;
		if(current>=0 && current<length)show(++current);
		
	}
	function show(i){
		$("#page").text(i+1);
		list_img.hide();
		$("#list_"+i).show();
		if(current==0)$("#prev").hide();
		else $("#prev").show();
		if(current==length-1)$("#next").hide();
		else $("#next").show();
		$("#News_news_thumb").val($("#list_"+i).attr("src"));
	}
	var tagStr = new Array();
	function doTag(){
		$(".tagname").each(function(){
				var Tags_tag_name = $("#News_news_tag");
			$(this).toggle(function(){
				var tagname = this.rel;
				$(this).css({'background':'#575757','color':'#fff'});
				var oldTagStr = Tags_tag_name.val();
				var oldTags = oldTagStr.ncSplit(' ');//字符串转换成数组
				if(tagStr.length != oldTags.length){
					tagStr.length=0; //清空数组
					tagStr = oldTags.slice(0); //复制数组
				}
				tagStr.push(tagname);
				var nowTags = tagStr.join(' ')+' '; //数组转换成字符串
				Tags_tag_name.val(nowTags).focus();
			},function(){
				var tagname = this.rel;
				tagStr.removeItem(tagname);//移除指定的名字的数组
				var nowTags = tagStr.join(' ')+' ';//数组转换成字符串
				Tags_tag_name.val(nowTags).focus();
				$(this).css({'background':'none','color':'#007CC3'});
			});
		});
	}
	
	
	$(function(){
		doTag();
	});


</script>